"""
*args: 接收位置参数
**kwargs: 接收关键字参数
*: 解包
important:
    *args返回值为元组解包
    args返回元组
    **kwargs返回字典的key值
    kwargs返回字典
"""


class A(object):

    def __init__(self, *args, **kwargs):

        print('*args: ', *args)
        print('*kwargs: ', *kwargs)

        print('args: ', args)
        print('kwargs: ', kwargs)

        print('*' * 20)


if __name__ == '__main__':
    a, *b = (1, 3, 4, 5)
    print(a, b)
    a = A()
    """
    输出
    *args:
    *kwargs: 
    args:  ()
    kwargs:  {}
    """
    b = A({'a': '2', 'b': 3})
    """
    *args:  {'a': '2', 'b': 3}
    *kwargs: 
    args:  ({'a': '2', 'b': 3},)
    kwargs:  {}
    """
    c = A(3, 4, 5, {'a': 6})
    """
    *args:  3 4 5 {'a': 6}
    *kwargs: 
    args:  (3, 4, 5, {'a': 6})
    kwargs:  {}
    """
    d = A(3, 5, (4, 5), a=1, b=2)
    """
    *args:  3 5 (4, 5)
    *kwargs:  a b
    args:  (3, 5, (4, 5))
    kwargs:  {'a': 1, 'b': 2}
    """
